<%@ page language="java" import="java.net.*"
	contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>我的笔记本登录页面</title>
<style type="text/css">
span {
	color: red;
}
a{
	font-size: 30px;
	
}
 body{    
      background-image: url(img/4.jpg);    
      background-repeat: repeat;    
 }    
</style>
</head>
<body>
	<%
		request.setCharacterEncoding("utf-8");
	String username = "" ;
	String password = "" ;

	Cookie[] cookies = request.getCookies();
	if(cookies != null && cookies.length > 0)
	{
		for (Cookie c:cookies)
		{
			if (c.getName().equals("username") )
			{
		username = URLDecoder.decode(c.getValue(),"utf-8");
			}
			if(c.getName().equals("password"))
			{
		password = URLDecoder.decode(c.getValue(),"utf-8"); 
			}
		}
	}
	%>


	<h1>
		<em><span>欢迎来到我的记事本</span></em>
	</h1>
	<hr>
	<div style="background-color:#618a56;">
	<form name="loginform" action="loginServlet" method="post">
		<table>
			<tr style="background-color:#a6ede1;">
				<td>用户名：</td>
				<td><input type="text" name="username" value="<%=username %>"></td>
			</tr>
			<tr style="background-color:#a6ede1;">
				<td>密码：</td>
				<td><input type="password" name="password" value="<%=password %>"></td>
			</tr>
			<tr>
				<td colspan="1" ><input type="checkbox" name="isUseCookie" checked="checked">十天内记住我的登录状态</td>
			</tr>
			<tr>
				<td><input type="submit" value="登录"></td>
				<td><input type="reset" value="重置"></td>
			</tr>
			<tr>
				
				<td><a title="点击此处进入注册页" href="enroll.jsp">新用户点击此处注册： </a></td>

			</tr>
		</table>
	</form>
	</div>
</body>
</html>